# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Simon Zeni <simon@bl4ckb0ne.ca>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=vulkan-loader
_pkgname=Vulkan-Loader
pkgver=1.3.296.0
pkgrel=0
arch="all"
url="https://www.khronos.org/vulkan"
pkgdesc="Vulkan Installable Client Driver (ICD) Loader"
license="Apache-2.0"
depends_dev="vulkan-headers"
makedepends="$depends_dev
	cmake
	libx11-dev
	libxrandr-dev
	python3
	samurai
	wayland-dev
	"
source="https://github.com/khronosgroup/vulkan-loader/archive/refs/tags/vulkan-sdk-$pkgver/vulkan-loader-sdk-$pkgver.tar.gz"
subpackages="$pkgname-dbg $pkgname-dev"
builddir="$srcdir/$_pkgname-vulkan-sdk-$pkgver"
options="!check" # No tests

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_DATADIR=share \
		-DCMAKE_SKIP_RPATH=True \
		-DVULKAN_HEADERS_INSTALL_DIR=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
535b7f324348e9edf44ff6a6a6e9eabe6e3a4bfad79bef789d1dc0cbbe3de36b6495a05236323d155631b081b89c18bb8668c79d1f735b59fc85ebee555aa682  vulkan-loader-sdk-1.3.296.0.tar.gz
"
